#ifndef __I2C_H
#define __I2C_H

#define SLAVE_ADDR		0xA0
#define SLAVE_ADDR_W	0xA0
#define SLAVE_ADDR_R	0xA1



#define RXBUF_LEN 15
#define TXBUF_LEN 15
typedef struct
{
	uint8_t type;
	uint8_t rxlen;
	uint8_t txlen;
	uint8_t rxbuf[RXBUF_LEN];
	uint8_t txbuf[TXBUF_LEN];
}i2c_t;

extern i2c_t I2c;
extern uint8_t I2cBuf[5];

void I2cSlaInit(void);
uint8_t I2cWrFifo(uint8_t dev, uint8_t *dat, uint8_t len);
uint8_t I2cRdFifo(uint8_t dev, uint8_t *dat, uint8_t len);


#endif	//__I2C_H
